@{
    ViewData["Title"] = "添加字典表";
    Layout = "~/Areas/Manager/Views/Shared/_Layout.cshtml";
}
<div class="layui-bg">
    <form class="layui-form" style="padding: 20px 30px 0 0;" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">键</label>
            <div class="layui-input-block">
                <input type="text" name="Name" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">父级</label>
            <div class="layui-input-block">
                <select id="ParentId" name="ParentId" asp-items="@ViewBag.ParentIdAll"></select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">值</label>
            <div class="layui-input-block">
                <input type="text" name="Value" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">业务分类</label>
            <div class="layui-input-block">
                <input type="text" name="Types" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">标识</label>
            <div class="layui-input-block">
                <input type="text" name="Signs" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" name="Remark" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="add" id="submit" type="button">提交</button>
                <button id="close" type="button" class="layui-btn layui-btn-primary">关闭</button>
            </div>
        </div>
    </form>
</div>
@section scriptsfeet
{
    <script type="text/javascript">
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径;
    }).use(['form','sykjwh'], function () {

        var $ = layui.$,form = layui.form,sykjwh = layui.sykjwh;

        $("#close").click(function () {
            sykjwh.close();
        });

        //表单提交
        form.on('submit(add)', function (obj) {
            sykjwh.save('@Url.Action("add", "Dic", new { area = Constant.AREAMANAGER })', obj.field);
        });
    });
    </script>
}
